#include "T_Action.h"
#include "T_Sprite.h"
#include "FrameSequence.h"

class Animation:public T_Action{
public:
	static Animation *create(const std::string &seq,float interval);
	virtual bool init(T_Node *node);
	virtual void startWithTarget(T_Node *sp);
	virtual bool isDone()const;
	virtual void update(int dt);

	void setInterval(float i){
		if(i<0)i=1;
		m_Interval=i;
	}
	bool setSequence(const std::string& nameSequence);
	virtual ActionType getActionType(){return ActionType::AnimateAction;}
protected:
	Animation();
	~Animation();

	float m_Interval;
	float m_Duration;
	int index;
	HBITMAP *m_BMPs;
	FrameSequence *m_Sequence;
};